name = 'xiaodengzi'

i = 0

length = len(name)  # 获取name字符串的长度

# 利用循环 打印字符串的内容和索引
while i < length:
    result = name[i]
    print(result + '的索引是', end='')
    print(i)
    i += 1


